/*
 * Conducao.java
 *
 * Created on October 7, 2007, 10:49 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package petstore.model;

import java.util.Collection;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity class Conducao
 * 
 * @author Tom Hayden
 */
@Entity
@Table(name = "conducao")
@AttributeOverride(name="id", column=@Column(name="cdconducao"))
public class Conducao extends BusinessObject {

    @Column(name = "dtconducao")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataConducao;

    @Column(name = "vlrtotconducao")
    private Double valorTotal;

    @Column(name = "ativo")
    private boolean active;

    @ManyToOne
    @JoinColumn(name="cdcliente")
    private Cliente cliente;

    @ManyToOne
    @JoinColumn(name="cdfuncionario")
    private Funcionario funcionario;
    
    @OneToMany(cascade = CascadeType.ALL)
    private Collection<AnimalTransportado> animaisTransportados;

    /** Creates a new instance of Conducao */
    public Conducao() {
    }

    public Date getDataConducao() {
        return dataConducao;
    }

    public void setDataConducao(Date dataConducao) {
        this.dataConducao = dataConducao;
    }

    public Double getValorTotal() {
        return valorTotal;
    }

    public void setValorTotal(Double valorTotal) {
        this.valorTotal = valorTotal;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public Funcionario getFuncionario() {
        return funcionario;
    }

    public void setFuncionario(Funcionario funcionario) {
        this.funcionario = funcionario;
    }

    public Collection<AnimalTransportado> getAnimaisTransportados() {
        return animaisTransportados;
    }

    public void setAnimaisTransportados(Collection<AnimalTransportado> animaisTransportados) {
        this.animaisTransportados = animaisTransportados;
    }

}
